package homework;

import java.util.function.Consumer;

/*
 * public interface Consumer<T> {
 * 		void accept(T t);
 * }
 */
class A{
	public static void a(int i) {
		i += 2;
		System.out.println(i);
	}
	public void b(String s) {
		s = s.replace("abc", "123");
		System.out.println(s);
	}
}

public class ConsumerDemo1 {

	public static void main(String[] args) {
		Consumer<String> con = System.out::println;
		con.accept("aaaaadsafa");
		
		Consumer<Integer> con1 =A::a;
		con1.accept(1);
		
		Consumer<String> con2 =new A()::b;
		con2.accept("afgabcttt");
	}

}